#ifndef ROLEMAN_H
#define ROLEMAN_H
#include <cgamemap.h>
#include <QKeyEvent>

class Roleman
{
public:
    //初始化主角属性
    void HeroInit(char name[20], CGameMap &gamemap);
    //主角的移动和判断下一位置进而实现不同的功能
    void HeroMove(CGameMap& gamemap,QKeyEvent *event);
    //主角的战斗
    void HeroFight(const int &id);
    void DrawMap(CGameMap& gamemap);
    void DrawBackground();
    char* GetName()
    {
        return m_Name;
    }
    int GetRedKey(){
        return m_RedKey;
    }
    int GetBlueKey()
    {
        return m_BlueKey;
    }
    int GetYellowKey()
    {
        return m_YellowKey;
    }
    int GetHp()
    {
        return m_Hp;
    }
    int GetLv()
    {
        return m_Lv;
    }
    int GetExp()
    {
        return m_Exp;
    }
    int GetAtt()
    {
        return m_Att;
    }
    int GetDef()
    {
        return m_Def;
    }
    int GetSword()
    {
        return m_Sword;
    }
    int GetMoney()
    {
        return m_Money;
    }
    int ChangeMoney(int x)
    {   m_Money+=x;
        return m_Money;
    }
    bool HaveSword(){
        return (m_Sword>0)?1:0;
    }
    int GetFloor()
    {
        return floor;
    }
    void ChangeFloor(bool a);//0下层，1上层
    void FlyFloor(int s);

private:
    char m_Name[20];
    unsigned int m_Lv;
    int m_RedKey;
    int m_YellowKey;
    int m_BlueKey;
    int m_MaxHp;
    int m_Hp;
    int m_Exp;
    int m_Money;
    int m_Att;
    int m_Def;
    int m_PosX;
    int m_PosY;
    int m_Sword;
    int floor;
};


#endif // ROLEMAN_H
